package demo.timewheel;

import cn.hutool.cron.timingwheel.TimerTask;
import cn.hutool.cron.timingwheel.TimingWheel;

/**
 * 时间轮测试
 */
public class TimerTest {

    public static void main(String[] args) throws InterruptedException {
        // TimerWheel timerWheel = new TimerWheel(10, TimeUnit.SECONDS, 128);
        // //创建任务延迟3秒执行
        // timerWheel.createTimerTask(() -> System.out.println("hello world"), 3, TimeUnit.SECONDS);

        TimingWheel timingWheel = new TimingWheel(1, 20, list -> {

        });
        timingWheel.addTask(new TimerTask(() -> {System.out.println("hello world");}, 10000));
        Thread.currentThread().join();
    }
}
